/**  
 * All rights Reserved, Designed By Android_Robot   
 * @Title:  ScrollableGridView.java   
 * @Package com.jiyi.widget   
 * @Description:    TODO(用一句话描述该文件做什么)   
 * @author: HYM     
 * @date:   2017-8-29 下午3:56:28   
 * @version V1.0     
 */  
package com.jiyi.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.GridView;

public class ScrollableGridView extends GridView {  
    boolean expanded = true;  
    public ScrollableGridView(Context context) {  
        super(context);  
    }  
    public ScrollableGridView(Context context, AttributeSet attrs) {  
        super(context, attrs);  
    }  
    public ScrollableGridView(Context context, AttributeSet attrs, int defStyle) {  
        super(context, attrs, defStyle);  
    }  
    @Override  
    public boolean onInterceptTouchEvent(MotionEvent ev) {  
        switch (ev.getAction()) {  
        case MotionEvent.ACTION_DOWN:  
            requestDisallowInterceptTouchEvent(true);  
        case MotionEvent.ACTION_MOVE:  
            break;  
        case MotionEvent.ACTION_UP:  
        case MotionEvent.ACTION_CANCEL:  
            requestDisallowInterceptTouchEvent(false);  
            break;  
        default:  
            break;  
        }  
        return super.onInterceptTouchEvent(ev);  
    }  
}  
